package com.hbhmzy.MyView;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.EditText;

/**
 * Created by hbhmzy on 2018/11/25/0025.
 */

public class MyEditText extends android.support.v7.widget.AppCompatEditText {
    private Paint mPaint;

    public MyEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        mPaint = new Paint();
        mPaint.setStyle(Paint.Style.STROKE);
        // 设置画笔的颜色
        //        mPaint.setColor(Color.BLUE);
        mPaint.setColor(0xffbfbfbf);
    }

    @Override
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        // 画直线，设置线的起点和终点
        canvas.drawLine(0, this.getHeight() - 1, this.getWidth() - 1,
                this.getHeight() - 1, mPaint);
        mPaint.setStrokeWidth((float) 5.0);
    }
}
